package com.qingzhuge.autoconfigure;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : zero.xiao
 * @description :
 * @date : 2018/7/4 0004 上午 10:59
 * @modified :
 * @since :
 */
@Data
public class SecurityProperties {
    /**开启jwt权限验证*/
    private boolean openJwt = false;
    /**开发对数据进行加密*/
    private boolean openEncrypt = false;
    /**token传递声明key*/
    private String token = "Authorization";
    /**token*/
    private String bearer = "Bearer:";
    /**swagger 测试token值*/
    private String tokenSwgValue;

    private String secret = "qingzhuge.com";
    /**token过期时间*/
    private Long expiration = 604800L;
    /**登录地址*/
    private String loginUrl = "/api/sys/open/login";
    private String logoutUrl = "/api/sys/open/logout";
    private String failureUrl = "/api/sys/open/error";
    /**需要权限验证的url前缀*/
    private List<String> authUrl = new ArrayList<>();
    /**需要跳过的权限验证的url前缀*/
    private List<String> excludeUrl = new ArrayList<>();

    SecurityProperties() {
        this.authUrl.add("/api/auth/**");
        this.authUrl.add("/api/sys/auth/**");
        this.excludeUrl.add("/api/open/**");
        this.excludeUrl.add("/api/sys/open/**");
    }
}
